//
//  GiftListViewController.m
//  YUXiu
//
//  Created by wang on 16/6/28.
//  Copyright © 2016年 Wang. All rights reserved.
//

#import "GiftListViewController.h"
#import "GiftTableViewCell.h"
#import "GiftNomalCell.h"


@interface GiftListViewController ()

@end
static NSString *identify = @"cell";

@implementation GiftListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"礼物贡献榜";
}
-(void)autoConfigViews{
//    [self.tableView registerNib:[UINib nibWithNibName:@"GiftTableViewCell" bundle:nil] forHeaderFooterViewReuseIdentifier:@"cell2"];
    [self.tableView registerNib:[UINib nibWithNibName:@"GiftTableViewCell" bundle:nil] forCellReuseIdentifier:identify];
    [self.tableView registerClass:[GiftNomalCell class] forCellReuseIdentifier:@"cell1"];
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row<3)  return 100;
    else return 60;
        
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    if (indexPath.row<3) {
        GiftTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify forIndexPath:indexPath];
        cell.numLabel.text = [NSString stringWithFormat:@"NO.%ld",(long)indexPath.row+1];
        cell.scoreLabel.text = [NSString stringWithFormat:@"贡献%ld积分",2000 +indexPath.row];
        cell.fansName.text = [NSString stringWithFormat:@"随心所动%ld",indexPath.row];
        
        return cell;
    }else{
        GiftNomalCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell1" forIndexPath:indexPath];
//        cell.numLabel.text = [NSString stringWithFormat:@"NO.%ld",(long)indexPath.row];
        [cell.levIcon setImage:kCreatImage(@"002")];
        cell.levIcon.layer.cornerRadius = 20;
        cell.levIcon.clipsToBounds = YES;
        return cell;

    }
   
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
